package Dict;

/**
 * Interface definition: Dictionnary.
 * 
 * @author OpenORB Compiler
 */
public abstract class DictionnaryPOA extends org.omg.PortableServer.Servant
        implements DictionnaryOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Dictionnary _this()
    {
        return DictionnaryHelper.narrow(_this_object());
    }

    public Dictionnary _this(org.omg.CORBA.ORB orb)
    {
        return DictionnaryHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:Dict/Dictionnary:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    private static final java.util.Map operationMap = new java.util.HashMap();

    static {
            operationMap.put("addEntity",
                    new Operation_addEntity());
            operationMap.put("delEntity",
                    new Operation_delEntity());
            operationMap.put("dictLength",
                    new Operation_dictLength());
            operationMap.put("findEntity",
                    new Operation_findEntity());
            operationMap.put("firstEntity",
                    new Operation_firstEntity());
            operationMap.put("lastEntity",
                    new Operation_lastEntity());
            operationMap.put("loadDict",
                    new Operation_loadDict());
            operationMap.put("modifDefinition",
                    new Operation_modifDefinition());
            operationMap.put("myDefinition",
                    new Operation_myDefinition());
            operationMap.put("nextEntity",
                    new Operation_nextEntity());
            operationMap.put("prevEntity",
                    new Operation_prevEntity());
            operationMap.put("saveDict",
                    new Operation_saveDict());
            operationMap.put("sortDict",
                    new Operation_sortDict());
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        final AbstractOperation operation = (AbstractOperation)operationMap.get(opName);

        if (null == operation) {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }

        return operation.invoke(this, _is, handler);
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_addEntity(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        Dict.CategoryValue arg1_in = Dict.CategoryValueHelper.read(_is);
        Dict.PropertyType arg2_in = Dict.PropertyTypeHelper.read(_is);
        String arg3_in = _is.read_string();

        try
        {
            addEntity(arg0_in, arg1_in, arg2_in, arg3_in);

            _output = handler.createReply();

        }
        catch (Dict.TermExisted _exception)
        {
            _output = handler.createExceptionReply();
            Dict.TermExistedHelper.write(_output,_exception);
        }
        catch (Dict.CategoryAndPropsNotMatch _exception)
        {
            _output = handler.createExceptionReply();
            Dict.CategoryAndPropsNotMatchHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_delEntity(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();

        try
        {
            delEntity(arg0_in);

            _output = handler.createReply();

        }
        catch (Dict.TermNotFound _exception)
        {
            _output = handler.createExceptionReply();
            Dict.TermNotFoundHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_modifDefinition(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        String arg1_in = _is.read_string();

        try
        {
            modifDefinition(arg0_in, arg1_in);

            _output = handler.createReply();

        }
        catch (Dict.TermNotFound _exception)
        {
            _output = handler.createExceptionReply();
            Dict.TermNotFoundHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_findEntity(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();

        try
        {
            Dict.Entity _arg_result = findEntity(arg0_in);

            _output = handler.createReply();
            Dict.EntityHelper.write(_output,_arg_result);

        }
        catch (Dict.TermNotFound _exception)
        {
            _output = handler.createExceptionReply();
            Dict.TermNotFoundHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_sortDict(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        boolean arg0_in = _is.read_boolean();

        sortDict(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_loadDict(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            int _arg_result = loadDict();

            _output = handler.createReply();
            _output.write_long(_arg_result);

        }
        catch (Dict.DicFileNotFound _exception)
        {
            _output = handler.createExceptionReply();
            Dict.DicFileNotFoundHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_saveDict(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        saveDict();

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_dictLength(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        int _arg_result = dictLength();

        _output = handler.createReply();
        _output.write_long(_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_firstEntity(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            Dict.Entity _arg_result = firstEntity();

            _output = handler.createReply();
            Dict.EntityHelper.write(_output,_arg_result);

        }
        catch (Dict.DictEmpty _exception)
        {
            _output = handler.createExceptionReply();
            Dict.DictEmptyHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_lastEntity(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            Dict.Entity _arg_result = lastEntity();

            _output = handler.createReply();
            Dict.EntityHelper.write(_output,_arg_result);

        }
        catch (Dict.DictEmpty _exception)
        {
            _output = handler.createExceptionReply();
            Dict.DictEmptyHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_nextEntity(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            Dict.Entity _arg_result = nextEntity();

            _output = handler.createReply();
            Dict.EntityHelper.write(_output,_arg_result);

        }
        catch (Dict.DictEmpty _exception)
        {
            _output = handler.createExceptionReply();
            Dict.DictEmptyHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_prevEntity(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        try
        {
            Dict.Entity _arg_result = prevEntity();

            _output = handler.createReply();
            Dict.EntityHelper.write(_output,_arg_result);

        }
        catch (Dict.DictEmpty _exception)
        {
            _output = handler.createExceptionReply();
            Dict.DictEmptyHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_myDefinition(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        String _arg_result = myDefinition();

        _output = handler.createReply();
        _output.write_string(_arg_result);

        return _output;
    }

    // operation classes
    private abstract static class AbstractOperation {
        protected abstract org.omg.CORBA.portable.OutputStream invoke(
                DictionnaryPOA target,
                org.omg.CORBA.portable.InputStream _is,
                org.omg.CORBA.portable.ResponseHandler handler);
    }

    private static final class Operation_addEntity extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_addEntity(_is, handler);
        }
    }

    private static final class Operation_delEntity extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_delEntity(_is, handler);
        }
    }

    private static final class Operation_modifDefinition extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_modifDefinition(_is, handler);
        }
    }

    private static final class Operation_findEntity extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_findEntity(_is, handler);
        }
    }

    private static final class Operation_sortDict extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_sortDict(_is, handler);
        }
    }

    private static final class Operation_loadDict extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_loadDict(_is, handler);
        }
    }

    private static final class Operation_saveDict extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_saveDict(_is, handler);
        }
    }

    private static final class Operation_dictLength extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_dictLength(_is, handler);
        }
    }

    private static final class Operation_firstEntity extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_firstEntity(_is, handler);
        }
    }

    private static final class Operation_lastEntity extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_lastEntity(_is, handler);
        }
    }

    private static final class Operation_nextEntity extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_nextEntity(_is, handler);
        }
    }

    private static final class Operation_prevEntity extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_prevEntity(_is, handler);
        }
    }

    private static final class Operation_myDefinition extends AbstractOperation
    {
        protected org.omg.CORBA.portable.OutputStream invoke(
                final DictionnaryPOA target,
                final org.omg.CORBA.portable.InputStream _is,
                final org.omg.CORBA.portable.ResponseHandler handler) {
            return target._invoke_myDefinition(_is, handler);
        }
    }

}
